package com.cgy.utils.base.tuple;

import com.cgy.utils.base.tuple.value.IValue0;
import com.cgy.utils.base.tuple.value.IValue1;
import com.cgy.utils.base.tuple.value.IValue2;

/**
 * 三元组
 *
 * @author CHTK
 */
public class Ternary<A, B, C> extends Tuple implements IValue0<A>, IValue1<B>, IValue2<C> {

    /**
	 * 
	 */
	private static final long serialVersionUID = 6854297227756685158L;
	private final A val0;
    private final B val1;
    private final C val2;

    public Ternary(final A value0, final B value1, final C value2) {
        super(value0, value1, value2);
        this.val0 = value0;
        this.val1 = value1;
        this.val2 = value2;
    }

    public static <A, B, C> Ternary<A, B, C> with(final A value0, final B value1, final C value2) {
        return new Ternary<A, B, C>(value0, value1, value2);
    }

    @Override
    public int getSize() {
        return 0;
    }

    @Override
    public A getValue0() {
        return this.val0;
    }

    @Override
    public B getValue1() {
        return this.val1;
    }

    @Override
    public C getValue2() {
        return this.val2;
    }
}
